package net.hmr_radio.hmrbot.util;

import java.io.IOException;

import javax.servlet.http.HttpServletResponse;

import net.arnx.jsonic.JSON;

import org.slim3.controller.Navigation;

public class JsonUtil {

    private JsonUtil() {
    }

    public static Navigation writeJson(HttpServletResponse response,
            Object object) throws IOException {
        response.setContentType("application/json");
        response.getWriter().write(JSON.encode(object));
        response.flushBuffer();

        return null;
    }
}
